from django.shortcuts import render

# Create your views here.

from django.http import HttpResponse

from .models import Book

import logging


def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")


def get_book(request, isbn):

    logging.debug(isbn)
    try:
        book = Book.objects.get(pk=isbn)
    except Book.DoesNotExist:
        book = None

    if book is None:
        return HttpResponse("Not found.")
    return HttpResponse("Founded.")
